/**
 * 
 */
package com.scpii.universal.hibernate.dao.impl;

import org.springframework.stereotype.Repository;

import com.scpii.universal.hibernate.dao.PageTitleDao;
import com.scpii.universal.hibernate.entity.PageTitleTab;

/**
 * genericWeb
 * @author weny
 * 2012-7-6上午11:03:30
 */
@Repository
public class PageTitleDaoImpl extends BaseDaoImpl<PageTitleTab, Integer> implements
		PageTitleDao {

	@Override
	public PageTitleTab getTitleByPageId(int pageId, String[] properties) {
		String hql = generateHqlByProperties(properties) +
			",TitlePageTab as t where entity.intTitleId=t.intTitleId" +
			" and t.intResourceId=?";
		return (PageTitleTab) getHibernateTemplate().getSessionFactory()
				.getCurrentSession().createQuery(hql).setParameter(0, pageId)
				.uniqueResult();
	}

}
